//
//  HeadlineViewController.m
//  OwnerNews
//
//  Created by lanou3g on 15/8/28.
//  Copyright (c) 2015年 Drawzyn. All rights reserved.
//

#import "HeadlineViewController.h"
#import "ViewController.h"

@interface HeadlineViewController ()

@property (nonatomic, strong) UITableView * tableView;

@end

static NSInteger i = 0;
@implementation HeadlineViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];

    self.tableView = [[UITableView alloc]initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStylePlain];
    
    [self.view addSubview:self.tableView];
    
    UIBarButtonItem * right = [[UIBarButtonItem alloc]initWithTitle:@"分类" style:UIBarButtonItemStyleDone target:self action:@selector(rightAction)];
    
    self.navigationItem.rightBarButtonItem = right;
    
    UIBarButtonItem * left = [[UIBarButtonItem alloc]initWithTitle:@"👥" style:UIBarButtonItemStyleDone target:self action:@selector(leftAction)];
    
    self.navigationItem.leftBarButtonItem = left;

    
}

- (void)SwipeAction {
    
    self.view.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
    
}


- (void)rightAction {
    
}
- (void)leftAction {
    
    i ++;
    
    ViewController *vie = [ViewController new];
    if (i == 1) {
        
        self.tableView.frame = CGRectMake(120, 0, self.view.bounds.size.width, self.view.bounds.size.height);
        
        [self.view addSubview:vie.DrawTableView];

    }else {
        self.tableView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
        
        [vie.DrawTableView removeFromSuperview];
        
        i = 0;
    }
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
